package com.violet.themvp

import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.viewbinding.ViewBinding
import com.violet.themvp.view.EmptyAppDelegate

/**
 * 简单的ui，不行实现mvp
 */
abstract class BaseAct<B: ViewBinding>: BaseDiAct<EmptyAppDelegate<B>>(){

    private lateinit var mViewBinding: B

    override fun canViewBinding(): Boolean {
        return true
    }

    override fun onResetContentView(): View {
        mViewBinding = onCreateVB(layoutInflater, null)
        return mViewBinding.root
    }

    abstract fun onCreateVB(inflater: LayoutInflater, container: ViewGroup?): B

    fun getViewBinding(): B {
        return mViewBinding
    }
}